import axios from '@/libs/axios1'
let jsonHeaders = { 'content-type': 'application/json;charset=UTF-8' }
let base = '/testplatform/businessSystem'
let baseUrlLink = '/testplatform/businessSystemUrlLink'

// 查询部件
export const querySystemList = params => {
  return axios({
    url: `${base}`,
    method: 'GET',
    params,
    headers: jsonHeaders,
  })
}


// 创建部件
export const addSystems = data => {
  return axios({
    url: `${base}`,
    method: 'POST',
    data,
    headers: jsonHeaders,
  })
}

// 修改部件
export const updateSystem = data => {
  return axios({
    url: `${base}`,
    method: 'PUT',
    data,
    headers: jsonHeaders,
  })
}

//批量关联
export const relativeSystemBatch = (params,data)=>{
  return axios({
    url: `${base}/batchLinkProduct`,
    params,
    method: 'PUT',
    data,
    headers: jsonHeaders,
  })
}


// 删除部件
export const deleteSystem = data => {
  return axios({
    url: `${base}`,
    method: 'DELETE',
    data,
    headers: jsonHeaders,
  })
}
// 测试系统部署记录
export const querySystemDeployRecord = (id,params) => {
  return axios({
    url: `${base}/${id}/relationship`,
    method: 'GET',
    params,
    headers: jsonHeaders,
  })
}
// 查询部件
export const querySystemListUrl = params => {
  return axios({
    url: `${baseUrlLink}`,
    method: 'GET',
    params,
    headers: jsonHeaders,
  })
}


// 创建部件
export const addSystemsUrl = data => {
  return axios({
    url: `${baseUrlLink}`,
    method: 'POST',
    data,
    headers: jsonHeaders,
  })
}

// 修改部件
export const updateSystemUrl = data => {
  return axios({
    url: `${baseUrlLink}`,
    method: 'PUT',
    data,
    headers: jsonHeaders,
  })
}


// 删除部件
export const deleteSystemUrl = id => {
  return axios({
    url: `${baseUrlLink}/${id}`,
    method: 'DELETE',
    headers: jsonHeaders,
  })
}
